************************************************
***Title: master.do
***Creators: Joelle Abramowitz, Shooshan Danagoulian, and Owen Fleming*
***Notes: This is a replication package for "Seasonal Allergies and Mental Health: Do Small Health Shocks Affect Suicidality?" First, write in the path corresponding to the location of the "replication_package" folder on your computer. Then, run the .do file and it will store all results in the "results" folder of the package. 

*For questions, contact
*Owen Fleming
*hg3490@wayne.edu
************************************************


**********SETUP
*Set your path to the location of the "replication_package" file
global path `INSERT PATH HERE'
cd ${path}

*Install programs
ssc install winsor
ssc install shufflevar

*Define macros
global weather tmin tmin_sq tmax tmax_sq tmean tmean_sq any_precip wind_speed wind_speed_sq


**********CLEAN
*Pollen data
do code/clean/pollen_clean.do

*NVDRS data
do code/clean/nvdrs_clean.do

*Weather data
do code/clean/weather_clean.do

*Wind data
do code/clean/wind_clean.do

*PM 2.5 data
do code/clean/pm2pt5_clean.do

*AQI data
do code/clean/aqi_clean.do

*Oak masting data
do code/clean/oak_masting_clean.do

*Merge all of the data and create analytic dataset
do code/clean/merge.do


**********FIGURES AND TABLES
*Figure 1
do code/analyze/figures/seasonal_trends_pollen.do

*Figure 3
do code/analyze/figures/time_series_pollen_suicide.do

*Figure 4
do code/analyze/figures/heterogeneity_by_demographic.do

*Table 1
do code/analyze/tables/summary_statistics.do

*Table 2
do code/analyze/tables/main.do

*Table 3
do code/analyze/tables/heterogeneity_by_underlying_mental_health.do

*Table 4
do code/analyze/tables/robustness_specifications.do

*Table 5
do code/analyze/tables/robustness_fixed_effects.do

*Table 6
do code/analyze/tables/mechanisms_trends.do


**********APPENDIX A
*Figure A1
do code/analyze/figures/seasonal_trends_pollen_by_region.do

*Figure A2
do code/analyze/figures/serial_correlation.do


**********APPENDIX C
*Figure C1
do code/analyze/figures/weather_association_distribution.do

*Figure C2
do code/analyze/figures/weather_association_locations.do

*Table C1
do code/analyze/tables/heterogeneity_by_weather_association.do

*Table C2
do code/analyze/tables/robustness_weather_lags.do

*Table C3
do code/analyze/tables/heterogeneity_by_season.do

*Table C4
do code/analyze/tables/heterogeneity_by_pollen_type.do

*Table C5
do code/analyze/tables/robustness_wind.do

*Table C6
do code/analyze/tables/robustness_additional_restrictions.do


**********APPENDIX D
*Table D1
do code/analyze/tables/robustness_pollution.do


**********APPENDIX E
*Figure E1
do code/analyze/figures/robustness_leave_one_out.do


**********APPENDIX F
*Figure F1
do code/analyze/figures/robustness_randomized_inference.do


**********APPENDIX G
*Table G1
do code/analyze/tables/robustness_station_cluster_restriction.do


**********APPENDIX H
*Table H1
do code/analyze/tables/robustness_oak_masting.do


**********APPENDIX I
*Table I1
do code/analyze/tables/robustness_iv.do






